<?php

class faq_content extends AppModel {

    var $alias = 'faq_content';
    var $name = 'faq_content';
    var $useTable = 'fags_articles';
    function paginateCount($conditions = null, $recursive = 0, $extra = array()) {
        $parameters = compact('conditions');
        $this->recursive = $recursive;
        $count = $this->find('count', array_merge($parameters, $extra));
        if (isset($extra['group'])) {
            $count = $this->getAffectedRows();
        }
        return $count;
    }

    function setListFaqarticleCache(){
        $cacheName  =   'list-faqarticle-info';
        $data = $this->find('all', array(
                    'conditions' => array('faq_content.published' => '1'),
                    'fields' => 'faq_content.id, faq_content.title, faq_content.alias, faq_content.short_description',
                    'order' => 'faq_content.ordering ASC',
                    'recursive'=>   -1
        ));
        $article_list   =   array();
        foreach($data AS $row){
            $article_list[$row['faq_content']['id']]    =   $row['faq_content'];
        }
        Cache::write($cacheName, $article_list, 'games');
    }
}

?>
